package com.xjm.i1.constant;

import lombok.Getter;

@Getter
public enum DataTypeEnum {

    MIN(28, 8), MAX(80, 8);

    private int row;

    private int column;

    DataTypeEnum(int row, int column) {
        this.row = row;
        this.column = column;
    }

    public static DataTypeEnum checkDataType(String fileName) {
        if (fileName.indexOf("_") > 0) {
            fileName = fileName.substring(0, fileName.indexOf("_"));
        }
        for (String val: AreaEnum.getVals()) {
            if (val.equals(fileName)) {
                if (val.equals(AreaEnum.CONTRAST.getVal())) {
                    return MAX;
                } else {
                    return MIN;
                }
            }
        }
        return null;
    }
}
